home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-01
/
tcoop10a.zip
/
DOC.ZIP
/
MOUSE.DOC
< prev
next >
Wrap
Text File
|
1991-11-20
|
6KB
|
127 lines
MOUSE.DOC 11/15/91 Copyright (c) 1991 by James S. Clark
==========================================================================
MOUSE
Mouse Class
--------------------------------------------------------------------------
Class Name Mouse
Superclass <none>
Category Device
Other classes referenced <none>
Other catagories referenced <none>
Used by Event
Inherited by <none>
Declaration Mouse *mouse
Instance Variables
int active;
Instance Methods
Mouse ();
~Mouse ();
void buttoninfo (int , int *, int *,
int *, int *);
void buttonpress(int , int *, int *,
int *, int *);
void buttonrel (int , int *, int *,
int *, int *);
int getstate (int *, int *);
void graphcursor(int , int , int []);
void hide ();
void motion (int *, int *);
void moveto (int , int );
void protect (int , int , int , int );
void ratio (int , int );
void reset ();
void setxrange (int , int );
void setyrange (int , int );
void show ();
void textcursor (int , unsigned ,
unsigned );
void threshold (int );
void usertask (unsigned , function );
--------------------------------------------------------------------------
GENERAL DESCRIPTION
The Mouse Class provides a means for communicating with a Microsoft Mouse
driver, or its equivalent. Methods are provided for displaying, hiding,
moving, and checking the botton status of the mouse.
--------------------------------------------------------------------------
VARIABLES
int active;
If the mouse driver is activated this value will be 1, otherwise
it will be 0.
--------------------------------------------------------------------------
METHODS
void buttoninfo (int button, int *status, int *count, int *x, int *y);
void buttonpress(int button, int *status, int *count, int *x, int *y);
Returns with the status and number of times that a selected button
has been pressed. (button 0=left, 1=right)
void buttonrel (int button, int *status, int *count, int *x, int *y);
Returns with the status and number of times that a selected button
has been released. (button 0=left, 1=right)
int getstate (int *x, int *y);
Returns with the mouse state. x and y are also passed and altered
by the call.
void graphcursor(int h_hot, int v_hot, int data[]);
Defines a new graphics cursor. The hot spot is given along with
an array of 32 bytes. The array contains 16 bytes for the image
and another 16 for the mask.
void hide ();
Decrements the cursor counter and if the count <1, hides cursor.
void motion (int *dx, int *dy);
Returns with the amount of mouse movement that has occured since
the last check. Positive values are down and to the right.
void moveto (int x, int y);
Moves the cursor to the specified coordinates.
void protect (int x1, int y1, int x2, int y2);
Protects an area on the screen from the mouse so drawing can
take place without turning off the cursor. The cursor will
disappear only in the prtected area. Call show() to clear it.
void ratio (int rx, int ry);
Sets the mickeys-to-pixel ratio. The default is 8 mickeys
horizontally and 16 mickeys vertically.
void reset ();
Determines if the mouse is installed and resets the defaults.
void setxrange (int min, int max);
Sets the horizontal limits for mouse movement on the screen.
void setyrange (int min, int max);
Sets the vertical limits for mouse movement on the screen.
void show ();
Increments the cursor counter and if >0 displays cursor.
void textcursor (int type , unsigned p1, unsigned p2);
Selects hardware or software text cursor. Select the type:
Software (1) sets the screen and cursor masks.
Hardware (2) sets the cursor start and stop scan lines.
void threshold (int dx);
Sets the double speed threshold. The speed is in mickeys-per-
second. The default is 16.
void usertask (unsigned mask, function eventhandler);
Allows you to specify a function within your program that can be
evoked whenever a mouse event occurs. The mask controls the
type of events that will trigger the handler. Bits 1-2 are for
button presses, bits 3-4 are for button releases.
--------------------------------------------------------------------------
MOUSE.DOC Copyright (c) 1991 by James S. Clark
==========================================================================